<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>玉灵 QQ:7031633 Email:webrx@126.com</title>
    <link rel="stylesheet" type="text/css" href="/static/simditor/simditor.css" />

    <script type="text/javascript" src="/static/simditor/jquery.min.js"></script>
    <script type="text/javascript" src="/static/simditor/module.js"></script>
    <script type="text/javascript" src="/static/simditor/hotkeys.js"></script>
    <script type="text/javascript" src="/static/simditor/uploader.js"></script>
    <script type="text/javascript" src="/static/simditor/simditor.js"></script>
    <script type="text/javascript" src="/static/simditor/mobilecheck.js"></script>
</head>

<body>
<textarea id="editor" placeholder="Balabala" autofocus></textarea>
<hr>
<section id="page-demo">
<textarea id="txt-content" data-autosave="editor-content" autofocus required>
<p>Simditor is a browser-based WYSIWYG text editor.
</p><p>It is used by <a href="http://tower.im">Tower</a> -- a popular project management web application.
</p><p>Supported Browsers: IE10+、Chrome、Firefox、Safari.</p>
<ul>
  <li><a href="https://github.com/mycolorway/simditor/releases" target="_blank" class="">Download Zip</a></li>
  <li>Install with npm: $ npm install simditor</li>
  <li>Install with bower: $ bower install simditor</li>
</ul>
</textarea>
</section>
<script>

    var editor = new Simditor({
        textarea: $('#editor')
        //optional options
    });

    (function() {
        $(function() {
            var $preview, editor, mobileToolbar, toolbar;
            Simditor.locale = 'en-US';
            toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment'];
            mobileToolbar = ["bold", "underline", "strikethrough", "color", "ul", "ol"];
            if (mobilecheck()) {
                toolbar = mobileToolbar;
            }
            editor = new Simditor({
                textarea: $('#txt-content'),
                placeholder: '这里输入文字...',
                toolbar: toolbar,
                pasteImage: true,
                defaultImage: 'assets/images/image.png',
                upload: location.search === '?upload' ? {
                    url: '/upload'
                } : false
            });
            $preview = $('#preview');
            if ($preview.length > 0) {
                return editor.on('valuechanged', function(e) {
                    return $preview.html(editor.getValue());
                });
            }
        });

    }).call(this);
</script>
</body>
</html>
